#ifndef ARRAYSORT_H_
#define ARRAYSORT_H_

typedef int (*CompareFunc)(const void *data1, const void *data2);

int compare_int(const int *data1, const int *data2);

int compare_string(const char **data1, const char **data2);

void bubble_sort(void *array, int size, int elem_size, CompareFunc comp_func);

void insertion_sort(void *array, int size, int elem_size, CompareFunc comp_func);

void shell_sort(void *array, int size, int elem_size, CompareFunc comp_func);

void heap_sort(void *array, int size, int elem_size, CompareFunc comp_func);

void merge_sort(void *array, int size, int elem_size, CompareFunc comp_func);
/* normal */
void quick_sort(void *array, int size, int elem_size, CompareFunc comp_func);
/* optimized tail recursion */
void quick_sort2(void *array, int size, int elem_size, CompareFunc comp_func);
/* no recursion */
void quick_sort3(void *array, int size, int elem_size, CompareFunc comp_func);

#endif /* ARRAYSORT_H_ */
